package com.hkyp.ss.course.provider.model.mediate;


import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 用户 关注-粉丝表
 *
 */
@Data
@Entity
@Table(
        indexes = {
                @Index(columnList = "fromId",name = "fromIdIndex"),
                //常做查询条件的列加索引
                @Index(columnList = "toId",name = "toIdIndex"),
        }
)
@DynamicUpdate
@DynamicInsert
public class UURelation implements Serializable{

    private static final long serialVersionUID = 102L;

    /**
     * id
     * 自增主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;


    /**
     * 用户id
     *
     */
    @Column()
    private Long fromId;

    /**
     * 关注的人
     */
    private Long toId;

    /**
     * 创建时间
     */
    @Column(name = "create_at")
    private Long createAt;

    /**
     * 更新时间
     */
    @Column(name = "update_at")
    private Long updateAt;

}
